<?php
namespace app\index\controller;
use think\Loader;
class Question extends Base{
    public function _initialize()
    {
        parent::_initialize();
        $this->assign('index_css',2);
        $this->assign('sie',pageSie(2));//页面描述与关键字
    }



    // 免费咨询列表页
    public function index(){
     $type                  = input('type');
     $tag                   = input('tag');
     $sort                  = input('sort');
     $invoking              = Loader::model('Question','service');
     $type_list             = $invoking->consultType();
     $data                  = $invoking->consultList($type,$tag,$sort);
     $this->assign('type',$type);
     $this->assign('tag',$tag);
     $this->assign('sort',$sort);
     $this->assign('list',$data['list']);
     $this->assign('page',$data['page']);
     $this->assign('type_list',$type_list);
     return $this->fetch();
    }


    // 免费咨询列表页
    public function detail(){
        $invoking                    = Loader::model('Question','service');
        $type_list                   = $invoking->consultType();
        $data                        = $invoking->consultDetail();
        $this->assign('type_list',$type_list);
        $this->assign('data',$data['data']);
        $this->assign('list',$data['list']);
        $this->assign('count',$data['count']);
        return $this->fetch();
    }


}
